<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateDataScopesTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('data_scopes', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('parent_id')->nullable()->comment('父级ID');
            $table->string('full_title')->comment('数据域全路径名称');
            $table->string('title')->comment('数据域名称');
            $table->string('code')->comment('数据域编码');
            $table->string('data_scope')->comment('数据域');
            $table->string('description')->nullable()->comment('数据域描述');
            $table->timestamps();

            $table->comment = '数据域表';
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('data_scopes');
    }

}
